package com.woniuxy.shop.Service.Serviceimpl;

import com.hc.entity.Goods;
import com.hc.entity.Paper;
import com.hc.entity.Shop;
import com.hc.utils.ResponseEntity;
import com.woniuxy.shop.Mapper.GoodsMapper;
import com.woniuxy.shop.Mapper.ShopMapper;
import com.woniuxy.shop.Service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *@ClassName GoodsServiceImpl
 *@Description
 *@Author TJ
 *@Date 2022/10/20 11:30
 *@Version 1.0
 **/
@Service
public class GoodsServiceImpl implements GoodsService {


    @Autowired
    GoodsMapper goodsMapper;

    @Autowired
    ShopMapper shopMapper;
    @Override
    public Shop getByGoodsId(int id) {


        Goods goods = goodsMapper.getByGoodsId(id);

        Shop shop = shopMapper.getByShopId(goods.getShopId());
        return shop;
    }

    @Override
    public List<Goods> getByShopId(int id) {
        List<Goods> goodsList = goodsMapper.getByShopId(id);
        return goodsList;
    }
}
 